home *** CD-ROM | disk | FTP | other *** search
- #ifndef _ztriangle_h
- #define _ztriangle_h
-
- #include <stdlib.h>
- #include <stdio.h>
- #include "zbuffer.h"
-
-
- #define ZCMP(z, zpix) ((z) >= (zpix))
- #define SAR_RND_TO_ZERO(v, n) (v / (1 << n))
- #define NB_INTERP 8
-
-
- typedef void (*draw_init_t) (int *_drgbdx, int drdx, int dgdx, int dbdx, int *color, ZBufferPoint *p2,
- float *fdzdx, float *fndzdx, float *ndszdx, float *ndtzdx, PIXEL *texture,
- float *dszdx, float *dtzdx, ZBuffer *zb, int dzdx);
-
- typedef void (*put_pixel_t) (int _a, int *zz, PIXEL *pp, int *tmp, int *rgb, int drgbdx, int *z,
- unsigned short *pz, int dzdx, int color, PIXEL *texture,
- unsigned int *s, unsigned int *t, int dsdx, int dtdx);
-
- typedef void (*draw_line_t) (int dzdx, int _drgbdx, int r1, int g1, int b1, unsigned short *pz1,
- PIXEL *pp1, int x1, int x2, int z1, float sz1, float tz1, float dszdx, float dtzdx,
- float fdzdx, float fndzdx, float ndszdx, float ndtzdx, PIXEL *texture);
-
- void renderTriangle(ZBuffer *zb, ZBufferPoint *p0, ZBufferPoint *p1, ZBufferPoint *p2, int color, int _drgbdx,
- PIXEL *texture, float fdzdx, float fndzdx, float ndszdx, float ndtzdx,
- char interp_z_d, char interp_rgb_d, char interp_st_d, char interp_stz_d,
- draw_init_t _draw_init, put_pixel_t _put_pixel, draw_line_t _draw_line);
-
-
- #endif
-